package com.pro.meeting.service.impl;

import java.util.Date;
import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.pro.meeting.bean.Users;
import com.pro.meeting.dao.UsersDao;
import com.pro.meeting.service.UsersService;
@Service
public class UsersServiceImpl implements UsersService {
	@Autowired
	UsersDao usersDao;
	
	@Override
	public Users getByWid(String wid) {
		// TODO Auto-generated method stub
		return usersDao.getByWid(wid);
	}

	@Override
	public Users getByEmail(String email) {
		// TODO Auto-generated method stub
		return usersDao.getByEmail(email);
	}

	@Override
	public int updateWidByEmail(String email, String wid) {
		// TODO Auto-generated method stub
		return usersDao.updateWidByEmail(email,wid);
	}

	@Override
	public int updateWxByUid(Users users ) {
		// TODO Auto-generated method stub
		return usersDao.updateWxByUid(users);
	}

	@Override
	public Users getByOpenid(String openid) {
		// TODO Auto-generated method stub
		return usersDao.getByOpenid(openid);
	}
//##############TODO 后台管理
	@Override
	public List<Users> getAll() {
		// TODO Auto-generated method stub
		return usersDao.getAll();
	}

	@Override
	public int delById(String id) {
		// TODO Auto-generated method stub
		return usersDao.delById(id);
	}

	@Override
	public int add(Users u) {
		// TODO Auto-generated method stub
		u.setUid(UUID.randomUUID().toString());
		u.setCurrtDate(new Date());
		u.setStatus(0);
		return usersDao.add(u);
	}

}
